<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>mtlb_i</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>M2SCI function</center>
    <div align="right">Last update : 30/03/2004</div>
    <p>
      <b>mtlb_i</b> - Matlab insertion emulation function</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Matlab and Scilab insertion behave differently in some particular cases:</p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
	When inserting a matrix in a variable: Matlab automaticaly adjusts output
	variable to fit with matrix to insert but not Scilab.
	For example, with A=1, A([1,2,3,4])=[1,2;3,4]) returns an error in Scilab
	while in Matlab we get A=[1,2,3,4]. If values miss comparing to indexes,
	Matlab fills output value with 0.
	</li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
	When inserting data into a character string matrix: due to the fact that character string matrices
	in Matlab can be adressed as any other matrix (each character can be adressed), insertion in such a type of
	matrix does not differ from other. But in Scilab it can't be done so...<tt>
              <b>mtlb_is</b>
            </tt> is an alternative.
 	</li>
        </dd>
      </dd>
    </dl>
    <p>
    The function <tt>
        <b>A=mtlb_i(A,k,B)</b>
      </tt> is used by
    <tt>
        <b>mfile2sci</b>
      </tt> to replace <tt>
        <b>A(k)=B</b>
      </tt> when it was not
    possible to know what were the operands while porting Matlab code to Scilab. This function will
    determine the correct semantic at run time. If you want to have a
    more efficient code it is possible to replace <tt>
        <b>mtlb_i</b>
      </tt> calls:
    </p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>    
	If <tt>
              <b>A</b>
            </tt> is not a vector
        <tt>
              <b>A=mtlb_i(A,k,B)</b>
            </tt> may be replaced by <tt>
              <b>A(k)=B</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>    
	If <tt>
              <b>A</b>
            </tt> and <tt>
              <b>B</b>
            </tt> are both row or column vectors
	<tt>
              <b>A=mtlb_i(A,k,B)</b>
            </tt> may be replaced by <tt>
              <b>A(k)=B</b>
            </tt>
          </li>
        </dd>
      </dd>
    </dl>
    <p>Caution: <tt>
        <b>mtlb_i</b>
      </tt> has not to be used for hand coded functions.</p>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="Matlab-Scilab_character_strings.htm">
        <tt>
          <b>Matlab-Scilab_character_strings</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="mtlb_is.htm">
        <tt>
          <b>mtlb_is</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>V.C.</dd>
    </dl>
  </body>
</html>
